<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="../../../common/include.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<jsp:include page="../../../common/head.jsp">
			 <jsp:param name="_spPage" value="true"/>
			 <jsp:param name="_useCalendar" value="true"/>
			 <jsp:param name="_useReport" value="true"/>
			 <jsp:param name="_useSuggest" value="true"/>
			 <jsp:param name="_useOrgSuggest" value="true"/>
			 <jsp:param name="_useEmpSuggest" value="true"/>
		</jsp:include>

		<title>查看费用信息</title>
		<script language="JavaScript">
			
			function goBack()
			{
				window.top.close();
			}
			function showData(feeId)
			{
				ModalWindow("jump.do?path=showFeeDetail.do&feeId="+feeId,800,600);
			}
			//选择费用类型
			function selectFeeType(){
				var code = ModalWindow("jump.do?path=listDictComm.do&toJsp=/jsp/common/code/lst_code_dict.jsp&kindId=004",640,480);
				if(code!=null)
				{
					var str = code.split("#");
					$("#feeTypeId").val(str[0]);
					$("#feeTypeName").val(str[1]);
				}
			}
		</script>
	</head>
	<body>
	<form action="listSameTypeFeeDetail.do" name="form1" id="form1" method="post">
	<div id="body_div">
	<w:ShowTitle name="费用查看" useSubmitKey="false">
	<w:TitleButton funcName="查询" onClickFunction="_queryDivBg(this)" urlImg="${ctx}/images/main/query.png"/>
	<w:TitleButton funcName="返回" onClickFunction="goBack()" urlImg="${ctx}/images/main/back.png"/>
	</w:ShowTitle>
	<div id="body_content">
				<div id="queryDiv">
			<table width="100%" border="0">
				<tr>
					<td colspan="4" class="td_title">
						费用查询
					</td>
				</tr>
				<tr>
					<td>地区</td>
					<td class="left_align">
						<w:select name="feeDetail.areaId" value="${feeDetail.areaId}">
							<w:option optionLabel="请选择" optionValue=""></w:option>
							<w:options options="${CodeDict}" optionLabel="codeName" optionValue="codeId" filterFieldName="parentCodeId" filterFieldValue="001"></w:options>
						</w:select>
					</td>
					<td>事业部</td>
					<td class="left_align">
              			<w:select name="feeDetail.areaDeptId" value="${feeDetail.areaDeptId}">
							<w:option optionLabel="请选择" optionValue=""></w:option>
							<w:options options="${CodeDict}" optionLabel="codeName" optionValue="codeId" filterFieldName="parentCodeId" filterFieldValue="002"></w:options>
						</w:select>
           			</td>  
				</tr>
				<tr>
					<td>发生对象</td>
					<td class="left_align">
						<w:select name="feeDetail.feeTarget" styleId="feeTarget" value="${feeDetail.feeTarget}" onchange="selectFeeTarget()">
							<w:option optionLabel="请选择" optionValue=""></w:option>
							<w:option optionLabel="地区人员" optionValue="地区人员"></w:option>
							<w:option optionLabel="地区" optionValue="地区"></w:option>
							<w:option optionLabel="销售分线" optionValue="销售分线"></w:option>
						</w:select>
					</td>
					<td>对象名称</td>
					<td class="left_align">
						<input type="text" id="targetName" name="feeDetail.targetId" value="${feeDetail.targetId}"/>
						<input type="hidden" id="feeId" name="feeDetail.feeId" value="${feeDetail.feeId}"/>
           			</td>  
				</tr>
				<tr>
					<td class="right_align">费用类别</td>
		              <td class="left_align">
		              	<input type="hidden" id="feeTypeId" name="feeDetail.feeTypeId" value="${feeDetail.feeTypeId}"/>
		              	<input type="text" name="feeDetail.feeTypeName" id="feeTypeName" class="inputQry" readonly="readonly" onclick="selectFeeType()" value="${feeDetail.feeTypeName}"/>
		              </td>
					<td></td>
					<td class="left_align">
						
					
           			</td>  
				</tr>
				<tr>
					<td>发生日期</td>
					<td class="left_align" colspan="3">
					  	<input type="text" name="feeDateFrom" onFocus="new WdatePicker()" readOnly="readOnly" class="inputCal" value="${feeDateFrom}"/>
						至
						<input type="text" name="feeDateTo" onFocus="new WdatePicker()" readOnly="readOnly" class="inputCal" value="${feeDateTo}"/>
					</td>
				</tr>
				<tr>
					<td>费用标注1</td>
					<td class="left_align">
					  	<input type="text" name="feeDetail.note1" id="note1" value="${feeDetail.note1}"/>
					</td>
					<td class="right_align">费用标注2</td>
		            <td class="left_align">
		              	<input type="text" name="feeDetail.note2" id="note1" value="${feeDetail.note2}"/>
		            </td>
				</tr>
				<tr>
					 <td colspan="4">
						<input name="button" type="submit" class="btn_standard" onclick="" value="查询" />
						<input name="button" type="button" class="btn_standard" onclick="_cancelQuery()" value="取消" />
					</td>
				</tr>
			</table>
			</div>	
				<table width="100%" class="listTable">
					<tr>
                        <td width="150" class="td_title">地区</td>
                        <td class="td_title">事业部</td>
                        <td class="td_title">发生对象</td>
                        <td class="td_title">对象名称</td>
                        <td class="td_title">费用类别</td>
                        <td width="80" class="td_title">登记日期</td>
                        <td width="80" class="td_title">财务主管</td>
                        <td width="80" class="td_title">上报金额</td>
                        <td width="80" class="td_title">核销金额</td>
                        <td width="80" class="td_title">费用日期</td>
                        <td width="100" class="td_title">操作</td>
                      </tr>
					<c:forEach items="${datalist}" var="obj">
						<tr>
							<td class="left_align">${obj.areaName}</td>
							<td class="left_align">${obj.areaDeptName}</td>
							<td class="left_align">${obj.feeTarget}</td>
							<td class="left_align">${obj.targetName}</td>
							<td class="left_align">${obj.feeTypeName}</td>
							<td class="left_align"><fmt:formatDate value='${obj.createDate}' pattern="yyyy-MM-dd" /></td>
							<td class="left_align">${obj.financeSupervisorName}</td>
							<td class="left_align">${obj.billAmount+obj.certificateAmount}</td>
							<td class="left_align">${obj.billAmountWrittenOff+obj.certificateAmountWrittenOff}</td>
							<td class="left_align"><fmt:formatDate value='${obj.feeDate}' pattern="yyyy-MM-dd" /></td>
							<td>
								<a href="#" onclick="javascript:showData('${obj.feeId}')">查看</a>
							</td>
						</tr>
					</c:forEach>
				</table>
				<w:spPage />
			</div>
		</div>	
		</form>
	</body>
</html>